package com.nlp.solve.issue_g;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

public class AuthorInfo implements Comparable<AuthorInfo> {

    public AuthorInfo(int count, String name, List<SubjectInfo> subjects) {
        this.count = count;
        this.name = name;
        this.subjects = subjects;
    }

    public AuthorInfo() {
    }

    @Override
    public int compareTo(AuthorInfo o) {
        return o.count - this.count;
    }

    static class SubjectInfo {
        String key;
        int value;

        public SubjectInfo(String key, int val) {
            this.key = key;
            this.value = val;
        }

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        public SubjectInfo() {
        }

        @Override
        public String toString() {
            return "SubjectInfo{" +
                    "key='" + key + '\'' +
                    ", value=" + value +
                    '}';
        }
    }

    int count;//count
    String name;//author name
    List<SubjectInfo> subjects;//author subjects


    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<SubjectInfo> getSubjects() {
        return subjects;
    }

    public void setSubjects(List<SubjectInfo> subjects) {
        this.subjects = subjects;
    }
}